﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Confucius.daoImpl;
using Confucius.entity;

namespace Confucius
{
    public partial class XMLParsing : PhoneApplicationPage
    {
        // Constructor
        public XMLParsing()
        {
            InitializeComponent();
        }

        private void parseBtn_Click(object sender, RoutedEventArgs e)
        {
            GameDAOImpl instance = new GameDAOImpl((Application.Current as App));
            List<GameHeader> data = instance.findRemoteGames();
            for (int i = 0; i < data.Count; i++)
            {
                textBlock1.Text += "****Record " + i;
                textBlock1.Text += "GameID: " + data.ElementAt(i).GameID + "\n";
                textBlock1.Text += "GameName: " + data.ElementAt(i).GameName + "\n";
                textBlock1.Text += "IconID: " + data.ElementAt(i).IconID + "\n";
                textBlock1.Text += "Status: " + data.ElementAt(i).Status + "\n";
                textBlock1.Text += "Version: " + data.ElementAt(i).Version + "\n";
            }
        }
    }
}